// To parse this JSON data, do
//
//     final cityListModel = cityListModelFromJson(jsonString);
import 'dart:convert';

import 'package:azlistview/azlistview.dart';

CityListModel cityListModelFromJson(String str) => CityListModel.fromJson(json.decode(str));

String cityListModelToJson(CityListModel data) => json.encode(data.toJson());

class CityListModel {
  CityListModel({
   required this.hot,
    required this.cityList,
  });

  List<Hot> hot;
  List<CityList> cityList;

  factory CityListModel.fromJson(Map<String, dynamic> json) => CityListModel(
    hot: List<Hot>.from(json["hot"].map((x) => Hot.fromJson(x))),
    cityList: List<CityList>.from(json["cityList"].map((x) => CityList.fromJson(x))),
  );

  Map<String, dynamic> toJson() => {
    "hot": List<dynamic>.from(hot.map((x) => x.toJson())),
    "cityList": List<dynamic>.from(cityList.map((x) => x.toJson())),
  };


}

class CityList{
  CityList({
    required this.prefix,
    required this.city,
  });

  String prefix;
  List<CityModel> city;

  factory CityList.fromJson(Map<String, dynamic> json) => CityList(
    prefix: json["prefix"],
    city: List<CityModel>.from(json["city"].map((x) => CityModel.fromJson(x))),
  );

  Map<String, dynamic> toJson() => {
    "prefix": prefix,
    "city": List<dynamic>.from(city.map((x) => x.toJson())),
  };


}

class CityModel extends ISuspensionBean {
  CityModel({
    required this.prefix,
    required this.id,
    required this.name,
    required this.pinyin,
  });
  var prefix;
  int id;
  String name;
  String pinyin;

  factory CityModel.fromJson(Map<String, dynamic> json) => CityModel(
    prefix: json["prefix"],
    id: json["id"],
    name: json["name"],
    pinyin: json["pinyin"],
  );

  Map<String, dynamic> toJson() => {
    "prefix": prefix,
    "id": id,
    "name": name,
    "pinyin": pinyin,
  };
  @override
  String getSuspensionTag() {
    // TODO: implement getSuspensionTag
    return prefix;
  }
}

class Hot {
  Hot({
    required this.id,
    required this.name,
  });

  int id;
  String name;

  factory Hot.fromJson(Map<String, dynamic> json) => Hot(
    id: json["id"],
    name: json["name"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "name": name,
  };
}
